package com.cskt.common.exception;

import com.cskt.common.entity.vo.StatusEnum;

/**
 * 自定义异常
 *
 * @author admin
 * @date 2023/04/14 16:58
 **/

public class BaseException extends RuntimeException{
    
    private StatusEnum statusEnum;
    private String errorCode;
    private String errorMsg;

    public BaseException(StatusEnum statusEnum) {
        super(statusEnum.getMsg());
        this.errorCode = statusEnum.getCode();
        this.errorMsg = statusEnum.getMsg();
        this.statusEnum = statusEnum;
    }

    public StatusEnum getStatusEnum() {
        return statusEnum;
    }

    public void setStatusEnum(StatusEnum statusEnum) {
        this.statusEnum = statusEnum;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
